<template>
  <div class="Banner">
    <van-nav-bar title="核桃仁"
                 right-text="绑定医生"
                 @click-right="bindDoctor"/>
    <!--    轮播图-->
    <div class="bannerList">
      <van-swipe class="my-swipe"
                 :autoplay="3000"
                 indicator-color="white">
        <van-swipe-item v-for="item in bannerImgList" :key="item.id"><img :src='item.src' alt=""></van-swipe-item>
      </van-swipe>
    </div>
  </div>
</template>

<script>
import {mapActions, mapGetters} from 'vuex'
import {Toast} from "vant";

export default {
  name: "Banner",
  computed: {...mapGetters(['loginUserInfo', 'userMoney', 'isBindDoctor', 'bannerImgList'])},
  data() {
    return {}
  },
  mounted() {
  },
  methods: {
    //轮播图
    bannerList() {
    },
    bindDoctor() {
      if (this.userMoney <= '0') {
        this.$dialog.confirm({
          message: '你还没有成为会员，请充值后再试！',
          confirmButtonText: '去充值'
        }).then(() => {
          this.$router.push('/mymessage');
        })
            .catch(() => {
              // on cancel
            });
      } else {
        this.$router.push('/bindDoctor');
      }
    }
  }
}
</script>

<style scoped lang="less">
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}

.bannerList {
  width: 100%;
  height: 200px;

  img {
    width: 100%;
    height: 200px;
  }
}
</style>
